﻿using ICMS.PluginInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace commonImportPlugin.Common
{
    public class Context
    {
        //
        //  基本参数
        //
        #region
        /// <summary>
        /// 成功导入的记录日志
        /// 一般是用于需要连接加密机的断点续传项目
        /// （目前有农行）
        /// </summary>
        public string succeedLogFilePth = null;
        /// <summary>
        /// 项目ID
        /// </summary>
        public string projectId { set; get; }
        /// <summary>
        /// 工单号
        /// </summary>
        public string taskId { set; get; }
        /// <summary>
        ///  加密机银行ID
        /// </summary>
        public string hsmBankId { set; get; }

        //金融加密机实例
        public IHSM[] pbocHSMs { set; get; }
        #endregion

        //
        //    其他
        //
        #region
        private static Context uniqueInstance;
        public void Init(Context _context)
        {
            uniqueInstance = _context;
        }
        /// <summary>
        /// 获取配置
        /// </summary>
        /// <returns></returns>
        public static Context GetConfig()
        {
            if (uniqueInstance == null)
            {
                return null;
            }
            return uniqueInstance;
        }
        #endregion
    }
}
